package com.mtsmda.test;

public class StringBufferAndStringBuilder {
	
	public static void main(String[] args) {
		chainedMethod();
		System.out.println("/////");
		lenghtAndCapacity();
		System.out.println("/////");
	}
	
	public static void chainedMethod(){
		StringBuilder builder = new StringBuilder();
		builder.append("JAVA").append(" Swing").append(" AWT");
		System.out.println(builder);
	}
	
	public static void lenghtAndCapacity(){
		StringBuilder builder = new StringBuilder();
		System.out.println("capacity - " + builder.capacity());
		System.out.println("length - " + builder.length());
		builder.append("JAVA").append(" Swing").append(" AWT");
		System.out.println("capacity - " + builder.capacity());
		System.out.println("length - " + builder.length());
		builder.append(",.");
		System.out.println("capacity - " + builder.capacity());
		System.out.println("length - " + builder.length());
		builder.append("1515151515151515151515151515151515d").append(" ");
		System.out.println("capacity - " + builder.capacity());
		System.out.println("length - " + builder.length());
		System.out.println(builder);
		System.out.println("capacity - " + builder.capacity());
		System.out.println("length - " + builder.length());
	}
	
}